package es.kivitel.android.sms.kernel;

import android.os.Handler;
import android.util.Log;

public class BackgroundEventScheduler implements Runnable {
	  private static final String TAG = BackgroundEventScheduler.class.getName();
	  private Handler serviceHandler = null;
	  private int countDown = 0;
	  private long interval = 0L;
	  
	  public BackgroundEventScheduler( int countDown, long interval, Handler serviceHandler ) {
		this.countDown = countDown;
		this.interval = interval;
		this.serviceHandler = serviceHandler;
	  }

	  public void run() {
		Log.d( TAG, "Counter: "+countDown );
		if( --countDown > 0 )
		  serviceHandler.postDelayed( this,interval );
	  }  

}
